//
//  QLMHomeButtonView.m
//  Xiaomakuaixiu
//
//  Created by 龚碧容 on 2018/1/31.
//  Copyright © 2018年 hwd. All rights reserved.
//

#import "QLMHomeButtonView.h"

@implementation QLMHomeButtonView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self _creatMainUI];
    }
    return self;
}

- (void)_setUpData:(NSString *)imageNameStr WithTitle:(NSString *)title{
    _userheaderImaView.image=[UIImage imageNamed:imageNameStr];
    _myphoneLable.text = title;
}

- (void)_creatMainUI{
    if (!_userheaderImaView) {
        _userheaderImaView=[[UIImageView alloc] init];
        _userheaderImaView.backgroundColor=[UIColor whiteColor];
        _userheaderImaView.image=[UIImage imageNamed:@"01_weixiu"];
        _userheaderImaView.frame=CGRectMake(0, 0, HomeButtonHeight, HomeButtonHeight);
        [self addSubview:_userheaderImaView];
    }
    if (!_myphoneLable) {
        _myphoneLable = [[UILabel alloc]initWithFrame:CGRectMake(0, HomeButtonHeight+5, HomeButtonHeight, 20)];
        _myphoneLable.text = @"维修";
        _myphoneLable.textAlignment=NSTextAlignmentCenter;
        _myphoneLable.font = [UIFont systemFontOfSize:16.0f];
        _myphoneLable.textColor=[UIColor blackColor];
        _myphoneLable.backgroundColor = [UIColor whiteColor];
        [self addSubview:_myphoneLable];
    }
    if (!_mynameBtn) {
        _mynameBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, HomeButtonHeight, HomeButtonHeight+25)];
        _mynameBtn.backgroundColor = [UIColor clearColor];
        [self addSubview:_mynameBtn];
    }
}

@end
